var status = -1;
var selectionLog = [];

function action(f, d, c) {
    if (status == 0 && f == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = c;
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            cm.curNodeEventEnd(true);
            cm.setInGameDirectionMode(true, false);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_AskAnswerTime(30);
            cm.inGameDirectionEvent_SetHideEffect(1)
        } else {
            if (status === b++) {
                cm.curNodeEventEnd(true);
                cm.setInGameDirectionMode(false, true);
                cm.setStandAloneMode(false);
                cm.onCreateGun();
                cm.onSetGun("shotgun", "shotgun", 1, 200, -8, -8, 8, 8);
                cm.onSetAmmo(40);
                var a = cm.getEventManager("副本_起源之塔");
                var e = a.getMapFactoryMap(cm.getMapId());
                var g = [9309116, 9309117];
                g.forEach(function (j) {
                    for (var h = 0; h < 10; h++) {
                        var k = a.getMonster(j);
                        e.spawnMonsterOnGroundBelow(k, new java.awt.Point(cm.rand(-300, 300), cm.rand(0, 300)))
                    }
                });
                cm.dispose()
            } else {
                cm.dispose()
            }
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};